package com.oliver.picturebackendspaceuserservice.controller.inner;

import com.oliver.picturebackendmodel.model.entity.SpaceUser;
import com.oliver.picturebackendopenfign.feignClient.SpaceUserFeignClient;
import com.oliver.picturebackendspaceuserservice.service.SpaceUserService;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * @ClassName SpaceUserInnerController
 * @Description TODO
 * @Author snow
 * @Date 2025/1/26 21:45
 **/
@RestController
@RequestMapping("/inner")
@Api(tags = "空间用户模块-openFeign")
public class SpaceUserInnerController implements SpaceUserFeignClient {

    @Resource
    private SpaceUserService spaceUserService;

    @PostMapping("/save")
    @Override
    public boolean save(@RequestBody SpaceUser spaceUser) {
        return spaceUserService.save(spaceUser);
    }

    @Override
    @GetMapping("/get/id")
    public SpaceUser getById(@RequestParam("spaceUserId") Long spaceUserId){
        return spaceUserService.getById(spaceUserId);
    }
}
